<!--导航面包屑公共组件-->
<template>
  <el-breadcrumb separator="/" class="breadcrumb">
    <el-breadcrumb-item v-for="nav in navPath" :key="nav.path" :to="{ path: nav.path }">{{nav.meta.title}}</el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script>
export default {
    created() {
        console.log("Breadcrumb组件被创建了")
    },
    computed:{
        navPath(){
            let match = this.$route.matched //可以拿到当前路由极其所有的父路由的信息
            console.log("当前路由的所有父路由信息",match)
            match[0].path="/"
            return match;

        }
    }
}
</script>

<style scoped>

.breadcrumb{
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: bold;
}
</style>